
const { exec } = require('child_process');

exec('git rev-parse --abbrev-ref HEAD', (err, branchName) => {
  if (err) {
    console.log('git error>>>', err)
  }
  if (branchName.trim() === 'master') {
    console.error(`
      error pre-commit：\n
      error message: \n
      master分支禁止提交
    `);
    process.exit(1);
  }
})